import request from '@/utils/request'

/** *
 * 分页
 * @param data
 */
function page(data) {
  return request({
    url: '/sapi/app/news/page',
    method: 'post',
    data: data
  })
}

/** *
 * 添加
 * @param data
 */
function add(data) {
  return request({
    url: '/sapi/app/news/add',
    method: 'post',
    data: data
  })
}

/** *
 * 修改
 * @param data
 */
function edit(data) {
  return request({
    url: '/sapi/app/news/edit',
    method: 'post',
    data: data
  })
}


function on(data) {
  return request({
    url: '/sapi/app/news/on',
    method: 'post',
    data: data
  })
}

function off(data) {
  return request({
    url: '/sapi/app/news/off',
    method: 'post',
    data: data
  })
}

/** *
 * 详情
 * @param data
 */
function detail(data) {
  return request({
    url: '/sapi/app/news/detail',
    method: 'post',
    data: data
  })
}

export default {
  page,
  add,
  detail,
  edit,
  on,
  off
}
